package com.dao.impl;

import com.dao.SearchHistoryDao;
import com.pojo.SearchHistory;
import com.utils.JDBCUtil;

import java.util.List;

public class SearchHistoryDaoImpl implements SearchHistoryDao {

    /**
     * 获取所有的数据
     * @param start
     * @param limit
     * @return
     */
    @Override
    public List<SearchHistory> findAll(int start,int limit) {
        return JDBCUtil.queryList(SearchHistory.class,"select * from s_search_history order by num desc limit ?,?",start,limit);
    }

    /**
     * 获取行数
     * @return
     */
    @Override
    public int selectCount() {
        return JDBCUtil.queryCount("select count(*) from s_search_history");
    }
}
